package com.share.rule.controller;

import java.util.List;

import com.share.common.core.domain.R;
import com.share.rule.api.domain.FeeRule;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.share.rule.service.IFeeRuleService;
import com.share.common.core.web.controller.BaseController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 费用规则Controller
 *
 * @author jixiang
 * @date 2025-07-22
 */
@Tag(name = "费用规则接口管理")
@RestController
@RequestMapping("/feeRule")
public class FeeRuleController extends BaseController
{
    @Resource
    private IFeeRuleService feeRuleService;

    @Operation(summary = "批量获取费用规则信息")
//    @InnerAuth
    @PostMapping(value = "/getFeeRuleList")
    public R<List<FeeRule>> getFeeRuleList(@RequestBody List<Long> feeRuleIdList)
    {
        return R.ok(feeRuleService.listByIds(feeRuleIdList));
    }

    @Operation(summary = "获取费用规则详细信息")
//    @InnerAuth
    @GetMapping(value = "/getFeeRule/{id}")
    public R<FeeRule> getFeeRule(@PathVariable("id") Long id)
    {
        return R.ok(feeRuleService.getById(id));
    }

}
